﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public struct DataType {
	public Vector3 pos;
	public string name;
}

public class Ball : MonoBehaviour, ISubject<DataType> {

	private DataType _dataType=new DataType{pos=Vector3.one,name="ball"};

	public Action<DataType> PublicAction { get; set; }
	private void PublishData () {
		if (PublicAction != null) PublicAction (_dataType);
	}
	void Start () {

	}
	void Update () {
		_dataType.pos=transform.position;
		PublishData ();
	}
}